﻿#region Copyright(C) 2013 FI Ltd. All rights reserved.

// ==================================================================================================
// Copyright(C) 2009 FI Ltd. All rights reserved.
//
// SYSTEM NAME	:   FI.Net Application Framework
// COMPONENT ID :   FI.ExceptionHandling
// COMPONENT DESC:  
//
// CREATED DATE/BY:  18 Aug 2018 / Tian Mi 
//
// REVISION HISTORY:	
// DATE/BY			SR#/CS/PM#/OTHERS		DESCRIPTION OF CHANGE
// ==================================================================================================

#endregion

using FI.Core.Utilities;
using System;

namespace FI.Core.ExceptionHandling
{
    /// <summary>
    /// This attribute is used to specifiy name of the exception policy to handle the exception thrown.
    /// </summary>
    [AttributeUsage( AttributeTargets.Class| AttributeTargets.Interface| AttributeTargets.Method, AllowMultiple = false)]
    public sealed class ExceptionPolicyAttribute: Attribute
    {
        #region Properties
        /// <summary>
        /// Gets the name of the exception policy.
        /// </summary>
        /// <value>
        /// The name of the exception policy.
        /// </value>
        public string ExceptionPolicyName { get; private set; }
        #endregion

        #region Constructors
        /// <summary>
        /// Initializes a new instance of the <see cref="ExceptionPolicyAttribute"/> class.
        /// </summary>
        /// <param name="exceptionPolicyName">Name of the exception policy.</param>
        public ExceptionPolicyAttribute(string exceptionPolicyName)
        {
            Guard.ArgumentNotNullOrEmpty(exceptionPolicyName, "exceptionPolicyName");
            this.ExceptionPolicyName = exceptionPolicyName;
        }
        #endregion
    }
}
